package com.steakliu.event.order.listener;

import com.steakliu.event.order.event.MessageEvent;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.event.EventListener;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

/**

/**
 * 功能说明：消息监听器
 *
 * <p>
 * Original @Author: steakliu-刘牌, 2022-06-25  19:52
 * <p>
 * Copyright (C)2020-2022  小四的技术之旅 All rights reserved.
 */
@Component
@Slf4j
public class MessageListener {

    @Async
    @EventListener(MessageEvent.class)
    public void sendMsg(MessageEvent messageEvent){
        log.info("发送短信至【{}】",messageEvent.getMessageDTO().getTel());
    }
}
